.PHONY:all
all:build_index search_engine.o libsearch_engine.so 

build_index:build_index.cc
	g++ -o $@ $^ -std=c++11 -lmysqlclient -ljsoncpp

search_engine.o:search_engine.cc
	g++ -fPIC -c search_engine.cc -std=c++11 -ljsoncpp 

libsearch_engine.so:search_engine.o search_engine.cc
	g++ -shared -o -fPIC -o libsearch_engine.so search_engine.o -std=c++11 -ljsoncpp 
	sudo mv libsearch_engine.so /usr/local/lib

.PHONY:clean
clean:
	rm build_index libsearch_engine.so  search_engine.o

